import java.util.*;

public class t2325 {
    //2325. 解密消息 简单
    public static void main(String[] args) {
        String key = "the quick brown fox jumps over the lazy dog", message = "vkbs bs t suepuv";

        //  System.out.println((int)'a');
        System.out.println(decodeMessage(key, message));
    }

    public static String decodeMessage(String key, String message) {
        char[] arr = key.replaceAll("[ ]", "").toCharArray();
        Set<Character> set = new HashSet<>();
        Map<Character, Character> map = new HashMap<>();
        map.put(' ',' ');
        int cr = 97;
        for (char c : arr) {
            if (!set.contains(c)) {
                map.put(c, Character.valueOf(((char) cr++)));
                set.add(c);
            }
        }
//        for (Map.Entry<Character, Character> characterCharacterEntry : map.entrySet()) {
//            System.out.print(characterCharacterEntry.getKey() +"-"+ characterCharacterEntry.getValue()+" ");
//        }
        StringBuffer sb = new StringBuffer();
        int len = message.length();
        for (int i = 0; i < len; i++) {
            sb.append(map.get(message.charAt(i)));
//            if (message.charAt(i) != ' ') {
//                sb.append(map.get(message.charAt(i)));
//            } else {
//                sb.append(" ");
//            }

        }
        return sb.toString();

    }
}
